package factorymodel.simpledesignmodel;

/**
 * Created by Administrator on 2018\8\2 0002.
 */
public class SenderFactory {
    public Sender SenderFactory(String msg){
        if (msg.equals("msg"))
            return new Msg();
        return new Mail();
    }

    public static void main(String[] args) {
        new SenderFactory().SenderFactory("msg").send();
        new SenderFactory().SenderFactory("mail").send();
    }
}
